export interface DictData{
    label: string;
    value: string|number;
}
export default function () {
    function translateDictCode(code: string|number,codes: DictData[]) {
        if (!code&&code!==0){
            return ""
        }
        if (!codes){
            return  ""
        }
        const dict = codes.find(d=>d.value == code)
        if (dict){
            return  dict.label
        }
        return  ""
    }
    return {
        translateDictCode
    }
}
